package main;

import java.awt.Graphics;

import javax.swing.JFrame;
import javax.swing.JOptionPane;

public class Main{


	/**
	 * @param args
	 */
	public static void main(String[] args){
		
		/*
		//2 player setup
		int totalplayers = Integer.parseInt(JOptionPane.showInputDialog("Total players?"));
		String[] names = new String[totalplayers];
		for(int i = 0; i < totalplayers; i++)
			 names[i] = JOptionPane.showInputDialog("Insert your name");
		
		//Get name  -- Make GUI prettier?
		//String name  = JOptionPane.showInputDialog("Insert your name");
		*/
		
		
		//Get grid size.  -- Make GUI prettier?
		int size; 
		do {
			size = Integer.parseInt(JOptionPane.showInputDialog("Insert size.\nSize must be between 3 and 6. (Inclusive)"));
		} while (size < 3 || size > 6); //Make sure input is on the right dimension
			
		//Generate random matrix
		MatrixGenerator matrixGenerator = new MatrixGenerator(size);
		//Controls controls = new Controls(matrixGenerator.getMatrix());
		RectangleGenerator rectangleGenerator = new RectangleGenerator(size);
		
		GridComponent gridComponent = new GridComponent(rectangleGenerator.getRectangles(), matrixGenerator.getMatrix());
		
		JFrame frame = new JFrame();
		frame.setSize(400, 422);
		frame.add(gridComponent);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setVisible(true);
		
	}
	
}
